/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package conceitos.componentes;

import java.awt.BorderLayout;
import java.awt.Component;
import java.io.IOException;
import java.net.URL;
import javax.swing.JPanel;
//import javax.media.CannotRealizeException;
//import javax.media.Manager;
//import javax.media.NoPlayerException;
//import javax.media.Player;
//import javax.media.Time;
//import javax.swing.JPanel;

/**
 *
 * @author jeferson
 */
public class MediaPlayer extends JPanel{
//    private Player player;
//
//    public MediaPlayer(URL url) {
//        Manager.setHint(Manager.LIGHTWEIGHT_RENDERER, true);
//        
//        try{
//            createPlayerAndShowComponents(url);
//        }
//        catch(NoPlayerException noPlayerException){
//            System.err.println("Formato de video não compativel");
//        }
//        catch(CannotRealizeException cannotRealizeException){
//            System.err.println("O sistema não possui os recursos necessários para reproduzir esse video");
//        }
//        catch(IOException IOException){
//            System.err.println("Erro na leitura do arquivo arquivo");
//        }
//
//    }
//    
//    private void createPlayerAndShowComponents(URL url) throws IOException, NoPlayerException, CannotRealizeException{
//        player = Manager.createRealizedPlayer(url);
//        
//        Component comp;
//        if((comp = player.getVisualComponent()) != null){
//            add(comp,BorderLayout.CENTER);
//        }
//        if((comp = player.getControlPanelComponent()) != null){
//            add(comp,BorderLayout.SOUTH);
//        }
//        
//        player.start();
//        player.setStopTime(new Time(0.1));
//    }
}
